GXGetShapePixel
You can use theGXGetShapePixel
function to determine the pixel value and the pixel offset of a specific pixel in a bitmap shape.
long GXGetShapePixel(gxShape source, long x, long y, gxColor *data, long *index);
source
- A reference to the bitmap shape containing the pixel to examine.
x
- The index of the column in which the pixel lies.
y
- The index of the row in which the pixel lies.
data
- A pointer to a
gxColor
structure. On return, this structure contains the color value of the specified pixel.index
- A pointer to a
long
value. On return, this value contains the color value of the specified pixel (if the pixel size of the bitmap is 16 or 32) or the specified pixel's index into the bitmap's color set (if the pixel size of the bitmap is 1, 2, 4, or 8).- function result
- The index of the byte containing the specified pixel in the source bitmap's
pixel image.DESCRIPTION
TheGXGetShapePixel
function copies the pixel value of the pixel determined by thex
andy
parameters from the source bitmap shape into thegxColor
structure pointed to by thedata
parameter.If the source bitmap shape has the
gxKeepShapeDirect
shape attribute set, this function also determines the pixel offset of the specified pixel and returns it in thelong
value pointed to by theindex
parameter. This function also returns a pointer to this value as the function result.ERRORS, WARNINGS, AND NOTICES
Errors out_of_memory shape_is_nil Warnings shape_does_not_contain_a_bitmap (debugging only) SEE ALSO
For information about thegxBitmap
structure, see "The Bitmap Geometry Structure" beginning on page 5-62.For information about pixels, pixel values, and pixel offsets, see "Bitmap Geometries" beginning on page 5-5.
To examine more than a single pixel of a bitmap, use the
GXGetBitmapParts
function, which is described on page 5-74.To change the value of a pixel, use the
GXSetShapePixel
function, which is described in the next section.
Main | Page One | What's New | Apple Computer, Inc. | Find It | Contact Us | Help